package com.ctshk.rpc.order.localfun.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.dto.payment.CallPayDTO;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.model.TokenUser;
import com.ctshk.common.req.pay.NotifyConsumeReq;
import com.ctshk.rpc.localfun.req.LocalFunProductOrderReq;
import com.ctshk.rpc.order.localfun.dto.*;
import com.ctshk.rpc.order.localfun.req.*;
import com.ctshk.rpc.order.localfun.req.h5.LocalFunH5OrderReq;
import com.ctshk.rpc.order.localfun.req.h5.LocalFunOrderAppCallPayReq;

/**
 * <p>
 * 当地玩乐App 服务类
 * </p>
 *
 * @author 廖胤松
 * @since 2021-05-12
 */
public interface ILocalFunAppOrderService {

    /**
     * 填写订单页新增订单与游客信息
     *
     * @param scenicAddCheckOrderReq 填写订单页新增订单与游客信息入参
     * @return 返回值
     */
    Result<Long> submit(LocalFunH5OrderReq scenicAddCheckOrderReq, Long loginUserId);

    /**
     * 根据订单id查询订单信息
     *
     * @param orderId 订单id
     * @return 订单消息
     */
    Result<LocalFunOrderPayQueryInfoDTO> queryOrderInfo(Long orderId);

    PageResponse<LocalFunOrderDTO> list(LocalFunOrderReq scenicOrderReq, TokenUser tokenUser);

    Result<LocalFunOrderDetailDTO>  localFunOrderDetail(LocalFunOrderDetailReq scenicOrderDetailReq);

    /**
     * 收款
     * @param scenic0rderCollectionDetailReq
     * @return
     */
    Result localFunOrderCollection(LocalFunOrderCollectionDetailReq scenic0rderCollectionDetailReq, TokenUser user);

    /**
     * 待付款状态取消订单
     * @param
     * @return
     */
    Result<Long> cancelLocalFunOrder(LocalFun0rderCancelReq scenic0rderCancelReq, Long userId);

    /**
     * 待确认、确认成功、确认取消状态取消订单
     * @param
     * @return
     */
    Result<Long> cancelLocalFunOrderRefund(AppLocalFunOrderRefundDetailReq scenic0rderRefundDetailReq, Long userId);

    /**
     * 确认订单
     * @param
     * @return
     */
    Result<Long> confirmOrder(LocalFunProductOrderReq scenicProductOrderReq, TokenUser tokenUser);

    /**
     * 通知旅客
     * @param
     * @return
     */
    Result notice(LocalFunOrderNoticeReq scenic0rderNoticeReq);

    /**
     * 订单超时 订单状态修改为取消状态
     * @param orderId
     * @return
     */
    Result<Long> updateOrderPaymentStatus(Long orderId);

    /**
     * 退款审批通过后，操作
     * @param localFun0rderRefundDetailReq
     * @param currentUser
     * @return
     */
    Result<Long> refundOperate(LocalFunOrderCheckReq localFun0rderRefundDetailReq, TokenUser currentUser);

    /**
     * 订单支付
     * @param payOrderReq
     * @param currentUserAllowNotLogInUserId
     * @return
     */
    Result payOrder(NotifyConsumeReq payOrderReq, Long currentUserAllowNotLogInUserId);

    /**
     * C端支付回调方法
     *
     * @param notifyConsumeReq
     * @return
     * @throws Exception
     */
    Result payment(NotifyConsumeReq notifyConsumeReq) throws Exception;

    /**
     * 订单详情
     * @param localFunOrderDetailReq
     * @param currentUserAllowNotLogInUserId
     * @return
     */
    Result<LocalFunOrderDetail> orderDetail(LocalFunOrderDetailReq localFunOrderDetailReq, Long currentUserAllowNotLogInUserId);

    /**
     * APP唤起支付
     * @param callPayReq
     * @return
     */
    Result callPay(LocalFunOrderAppCallPayReq callPayReq);

    /**
     * 查询支付结果
     * @param id
     * @return
     */
    Result<AppQueryPayResultDTO> queryPayResult(Long id);

    /**
     * 删除已取消的订单
     * @param orderId
     * @return
     */
    Result<Long> deleteCancelOrder(Long orderId);

    /**
     * 唤起支付
     * @param id
     * @return
     */
    CallPayDTO getCallPayInfo(Long id);
}
















